package com.example.hms.controller;

import com.example.hms.entity.RoomType;
import com.example.hms.entity.User;
import com.example.hms.service.RoomTypeService;
import com.example.hms.util.Result;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;

@RestController
@RequestMapping("/roomType")
public class RoomTypeController {
    @Resource
    private RoomTypeService roomTypeService;

    @RequestMapping(value = "/selectAllRoomType",method = RequestMethod.GET)
    public Result selectAllRoomType(String roomTypeName, BigDecimal roomPrice) {
        return roomTypeService.selectAllRoomType(roomTypeName,roomPrice);
    }

    @RequestMapping(value = "/insert",method = RequestMethod.GET )
    public Result insert(RoomType roomType, HttpServletRequest request) {
        return roomTypeService.insert(roomType,request);
    }

    @RequestMapping(value = "/update",method = RequestMethod.GET)
    public Result update(RoomType roomType, HttpServletRequest request)
        {return roomTypeService.update(roomType,request);}

    @RequestMapping(value = "/delete",method = RequestMethod.GET)
    public Result delete(String roomTypeId, HttpServletRequest request)
        {return roomTypeService.delete(roomTypeId,request);}

}
